<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<body>
<body>
  <ul class="forminfo" style="margin-top: 20px;">
  		<li><label>学生姓名</label><div class="label_right">${practiceChange.studentName}</div></li>
    	<li><label>实习变更前</label><div class="label_right"><c:if test="${practiceChange.currentStatus==0}">在校</c:if>
			<c:if test="${practiceChange.currentStatus==1}">自主创业</c:if>
			<c:if test="${practiceChange.currentStatus==2}">专升本</c:if>
			<c:if test="${practiceChange.currentStatus==3}">自寻企业实习</c:if>
			<c:if test="${practiceChange.currentStatus==4}">学校分配企业</c:if>  - ${practiceChange.currentEnterpriseName}</div></li>
    	<li><label>实习变更后</label><div class="label_right"><c:if test="${practiceChange.toStatus==0}">在校</c:if>
			<c:if test="${practiceChange.toStatus==1}">自主创业</c:if>
			<c:if test="${practiceChange.toStatus==2}">专升本</c:if>
			<c:if test="${practiceChange.toStatus==3}">自寻企业实习</c:if>
			<c:if test="${practiceChange.toStatus==4}">学校分配企业</c:if> - ${practiceChange.enterpriseName} </div></li>
    	 <li><label>实习单位地址</label><div class="label_right">${practiceChange.theAddress}</div></li>
    	  <li><label>企业联系人</label><div class="label_right">${practiceChange.theContact}</div></li>
    	  <li><label>联系人电话</label><div class="label_right">${practiceChange.thePhone}</div></li>
    	  <li><label>请求变更理由</label><div class="label_right">${practiceChange.applyCause}</div></li>
    	 	<li><label>实习开始时间</label><div class="label_right">${practiceChange.startTime}</div></li>
    	<li><label>实习结束时间</label><div class="label_right">${practiceChange.endTime}</div></li>
    	 <li><label>审核结果</label>
    	 <div class="label-light">
  				<span class="radio_first" id=""><input type="radio" name="xzlx" id="" value="0" checked="checked"   onclick="adopt();"/>审核通过</span><span class="radio_second" id=""><input type="radio" name="xzlx" id="" value="1" onclick="onAdopt()"/>审核不通过</span>
  		       </div>
  		</li>
  		<div id="reason">
    	 <li><label>审核不通过原因</label><div class="label_right"><textarea class="long_text long_text2" name="declineReason" maxlength="1000"></textarea></div></li>
    	 </div>
		<li><label>&nbsp;</label><input name="" type="button" class="btn" onclick="submitForm()" value="确认保存"></li>
    </ul>
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="js/jquery.tips.js"></script>
     <script src="layer/layer.js"></script>
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$("#reason").hide();
	
	var id = '${practiceChange.id}'
	function adopt(){
			$("#reason").hide();
	}
	function onAdopt(){
			$("#reason").show();
	}
	function submitForm() {
		var a = $("input[name='xzlx']:checked").val();
		if(a==1){
			if ($("textarea[name='declineReason']").val() == "") {
				showTips($("textarea[name='declineReason']"), '请填写审核不通过原因!');
				return false;
				}
		}
		$.ajax({
			type: "POST",
			url: "practiceChange/review.do",
			data: { id : id,checkApprove : a,declineReason :$("textarea[name='declineReason']").val()},
			async: true,
			dataType: "json",
			success: function(data) {
				if("success" == data.result){
					parent.closeAll();
			}else {
				layer.alert('审核失败!', {
		            skin: 'layer-ext-moon' 
		        });
				}
				}
			}) 
		}
	function showTips(obj,tips) {
		obj.tips({
			side:3,
	        msg:tips,
	        bg:'#e69138',
	        time:2
	    });
	}
	</script>
</body>
</html>
